<?php
global $base_dir;
$base_dir='./';

/**** 模块调用*****/
include_once($base_dir."inc/inc_connect.php");		//通用函数包含文件
?>
<?php
$web_admin= new Tbl_Act('web_admin','id'); 
if(is_array($_POST))
{
	foreach($_POST as $key => $value)
	{
		$$key=$value;
		$web_admin->$key=$value;
	}
}

if($admin_username=='' || $admin_pwd=='' || $checkcode=='')
{
	header("location:index.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理系统</title>

</head>
<body>
<?php
if($_SESSION['check_code']!=$checkcode)
{
	$url='index.php';
	$content="验证码不正确...";
	$time=1000;
	gopage($url,$content,$time);
}
else
{
	$web_admin->admin_pwd=md5($admin_pwd);
	$rs_num=$web_admin->RsCount(array('admin_username,=','admin_pwd,='));
	if($rs_num==1)
	{
		$_SESSION['admin_user']=$web_admin->admin_username;
		$url='mains.html';
		$content="登录成功...";
		$time=1000;
		gopage($url,$content,$time);
	}
	else
	{
		$url='index.php';
		$content="用户名或密码不正确...";
		$time=1000;
		gopage($url,$content,$time);
	}
}
unset($web_admin);
?>
<!-- 7caihu.com Baidu tongji analytics -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");

document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fb8797ecb21d1ccb839c35b190277a0cd' type='text/javascript'%3E%3C/script%3E"));

</script>
</body>
</html>